<script setup lang='ts'>
import ChannelNav from '@/components/ChannelNav.vue';
import ArticleList from '@/components/ArticleList.vue';
import { useChannel } from '@/hooks/channel';

const { channelList, activeId, updateActiveId } = useChannel()

</script>

<template>
  <!-- 频道 -->
  <!-- <ChannelNav :channels="channelList" :active-id="activeId" @update-active-id="activeId = $event"></ChannelNav> -->
  <ChannelNav :channels="channelList" :active-id="activeId" @update-active-id="updateActiveId"></ChannelNav>
  <!-- 列表 -->
  <ArticleList :active-id="activeId"></ArticleList>
  <div class="fix">
    <router-view></router-view>
  </div>
</template>

<style scoped>
.fix {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}
</style>